CREATE TABLE [dbo].[KpiInstance]
(
[Oid] [uniqueidentifier] NOT NULL ROWGUIDCOL,
[ForceMeasurementDateTime] [datetime] NULL,
[KpiDefinition] [uniqueidentifier] NULL,
[Settings] [nvarchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OptimisticLockField] [int] NULL,
[GCRecord] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[KpiInstance] ADD CONSTRAINT [PK_KpiInstance] PRIMARY KEY CLUSTERED  ([Oid]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [iGCRecord_KpiInstance] ON [dbo].[KpiInstance] ([GCRecord]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [iKpiDefinition_KpiInstance] ON [dbo].[KpiInstance] ([KpiDefinition]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[KpiInstance] WITH NOCHECK ADD CONSTRAINT [FK_KpiInstance_KpiDefinition] FOREIGN KEY ([KpiDefinition]) REFERENCES [dbo].[KpiDefinition] ([Oid]) NOT FOR REPLICATION
GO
